using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using CMS.Data;
using CMS.Core.Domain;

namespace CMS.Web.Lookups
{
    public partial class ViewDetail : System.Web.UI.Page
    {
        DonThu donThu = new DonThu();
        protected void Page_Load(object sender, EventArgs e)
        {
            String idDonThu = Request["ID"];
            donThu = NHibernateDaoFactory.Instance.GetDonThuDao().GetById(idDonThu);
            this.SetDetail();
        }

        private void SetDetail()
        {
            this.lblSoThuLy.Text = this.donThu.SoThuLy.ToString();
            this.lblHoTen.Text = this.donThu.HoTen;
            this.lblDiaChi.Text = this.donThu.DiaChi;
            this.lblLoaiDon.Text = this.donThu.LoaiDon.TenLoaiDon;
            this.lblLinhVuc.Text = this.donThu.LinhVuc.TenLinhVuc;
            this.lblLanThu.Text = this.donThu.LanGui.ToString();
            this.lblDonDeNgay.Text = (this.donThu.DonDeNgay != null) ? ((DateTime)this.donThu.DonDeNgay).ToString("dd/MM/yyyy") : "";
            this.lblNoiDung.Text = this.donThu.NoiDung;
            this.lblKetQuaGiaiQuyet.Text = this.donThu.KetQuaGiaiQuyet;
            if (this.donThu.ChuyenTieps != null && this.donThu.ChuyenTieps.Count > 0)
            {
                this.lblLDUBND.Text = donThu.ChuyenTieps[0].YKienLDUBND;
                this.lblLDVP.Text = donThu.ChuyenTieps[0].YKienLDVP;
            }
            //string vbcd = "";
            //if (donThu.VBCDs != null && donThu.VBCDs.Count > 0)
            //{
            //    foreach (VanBan vb in donThu.VBCDs)
            //    {
            //        vbcd += vb.TenVanBan + "<br/>";
            //    }
            //}
            //this.lblVBCD.Text = vbcd;
            //if (donThu.TrangThaiXuLy != null)
            //{
            //    this.lblTrangThai.Text = donThu.TrangThaiXuLy.TenTTXL;
            //}
        }

        protected override void OnPreInit(EventArgs e)
        {
            this.Theme = "red";
            base.OnPreInit(e);
        }
    }
}
